package com.example.qqfragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class ContextFragment extends Fragment {
    TextView textView;

    @Nullable
    @Override
    //加载入framelayout布局中创建视图
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.activity_fragment_tab,container,false);//动态加载布局
        textView=view.findViewById(R.id.content_text);//绑定布局中的控件id
        Bundle bundle=getArguments();//传数据
        if(bundle!=null){
            String textValue=bundle.getString("textValue");//将文本框的值赋值为传入的textValue
            textView.setText(textValue);
        }
        return view;
    }


}
